 

use "replication data audit.dta", clear

by 	treatment, sort: sum response_num
	
tab response_num // 18.3% response (can we benchmark this to other audit studies?)	
tab response_num if response~="BOUNCED" // 22% among those who didn't bounce
	

**** Response Rates by State


replace state=upper(state)
replace state=trim(state)
table state , c(m response_num count response_num)

*gen no_race=1 if state=="LA" | state=="MS" | state=="NJ" | state=="VA" | state=="DC"
replace no_race=0 if no_race==.

tab response_num no_race, col
tab response_num no_race if response~="BOUNCED", col

ttest response_num , by(no_race)

disp .025177 /.1853601 

tab response_num  if no_race==0
tab response_num  if response~="BOUNCED" & no_race==0


*******The media is not biased in the news they choose to cover: we can be very precise in that regard--take a strong stance on this, collect counternarratives/survey data, are biased in how they cover but not what they cover.




*No Controls
regress response_num treatment_4 treatment_2 treatment_1, cluster(cluster) // relative to strong conservative
regress response_num treatment_3 treatment_2 treatment_1, cluster(cluster) // relative to strong progressive
regress response_num treatment_3 treatment_4 treatment_1, cluster(cluster) // relative to moderate progressive
regress response_num treatment_2 treatment_4 treatment_3, cluster(cluster) // relative to moderate conservative

*Among non bounced emails
regress response_num treatment_4 treatment_2 treatment_1 if response~="BOUNCED", cluster(cluster) // relative to strong conservative
regress response_num treatment_3 treatment_2 treatment_1 if response~="BOUNCED", cluster(cluster) // relative to strong progressive
regress response_num treatment_3 treatment_4 treatment_1 if response~="BOUNCED", cluster(cluster) // relative to moderate progressive
regress response_num treatment_2 treatment_4 treatment_3 if response~="BOUNCED", cluster(cluster) // relative to moderate conservative


*With Controls
*	egen response_num_std=std(response_num), mean(0) std(1)

*In paper
areg response_num treatment_3 treatment_2 treatment_1 i.positionx_num i.specificfocusx_num i.femalex per_demx, cluster(cluster) absorb(statey) // relative to strong progressive
	sum response_num if e(sample)==1
	disp 0.0234556/.3877706 
	test treatment_3=-.024
	test treatment_3=-.054
	
	*Holding out non-election states
	areg response_num treatment_3 treatment_2 treatment_1 i.positionx_num i.specificfocusx_num i.femalex per_demx if state~="LA" & state~="MS" & state~="NJ" & state~="VA" &  state~="DC", cluster(cluster) absorb(statey) // relative to strong progressive


	
areg response_num treatment_4 treatment_2 treatment_1 i.positionx_num i.specificfocusx_num i.femalex per_demx, cluster(cluster) absorb(statey) // relative to strong conservative
areg response_num treatment_3 treatment_4 treatment_1 i.positionx_num i.specificfocusx_num i.femalex per_demx, cluster(cluster) absorb(statey) // relative to moderate progressive
areg response_num treatment_2 treatment_4 treatment_3 i.positionx_num i.specificfocusx_num i.femalex per_demx, cluster(cluster) absorb(statey) // relative to moderate conservative

areg response_num_std treatment_3 treatment_2 treatment_1 i.positionx_num i.specificfocusx_num i.femalex per_demx, cluster(cluster) absorb(statey) // relative to strong progressive

*BY ROLES
regress response_num treatment_4 treatment_2 treatment_1 if positionx=="Editor", cluster(cluster) // relative to strong conservative
regress response_num treatment_4 treatment_2 treatment_1 if positionx=="Publisher", cluster(cluster) // relative to strong conservative
regress response_num treatment_4 treatment_2 treatment_1 if positionx=="Reporter", cluster(cluster) // relative to strong conservative



***PERMUTATION TESTS, FULL SAMPLE
*set seed 123456789
*permute response_num "areg response_num treatment_1 treatment_2 treatment_3 i.positionx_num i.specificfocusx_num i.femalex per_demx, cluster(cluster) absorb(statey)" _b, reps(1000) saving("treatment_permute")
*use "/Users/johnholbein/Dropbox (Batten School @ UVA)/Work/Journalist Audit Study/treatment_permute.dta", clear
*saveold"/Users/johnholbein/Dropbox (Batten School @ UVA)/Work/Journalist Audit Study/treatment_permute.dta", version(12) replace

***PERMUTATION TESTS, Holding Out Non-Election States
*set seed 123456789
*gen response_num_no_elect_out=response_num
*replace response_num_no_elect_out=.  if state=="LA" | state=="MS" | state=="NJ" | state=="VA" |  state=="DC" 
*permute response_num_no_elect_out "areg response_num_no_elect_out treatment_1 treatment_2 treatment_3 i.positionx_num i.specificfocusx_num i.femalex per_demx, cluster(cluster) absorb(statey)" _b, reps(1000) saving("treatment_permute_no_elect_states_held_out")
*use "/Users/johnholbein/Dropbox (Batten School @ UVA)/Work/Journalist Audit Study/treatment_permute_no_elect_states_held_out.dta", clear
*saveold "/Users/johnholbein/Dropbox (Batten School @ UVA)/Work/Journalist Audit Study/treatment_permute_no_elect_states_held_out.dta", replace version(12)


*By Ideology Newspaper (with controls)

sum newsideology_newsideology_rpaper, d

*gen newspaper_3 = 1 if newsideology_newsideology_rpaper==1 | newsideology_newsideology_rpaper==2 | newsideology_newsideology_rpaper==3  // conservative
replace newspaper_3 = 2 if newsideology_newsideology_rpaper==4 | newsideology_newsideology_rpaper==5 // liberal

regress response_num treatment_3 treatment_2 treatment_1 i.positionx_num i.specificfocusx_num i.femalex per_demx if newspaper_3==1, cluster(cluster)
regress response_num treatment_3 treatment_2 treatment_1 i.positionx_num i.specificfocusx_num i.femalex per_demx if newspaper_3==2, cluster(cluster)

*By Ideology Twitter: Stratifying
sum ideot2, d
_pctile ideot2 , p(33)
return list
_pctile ideot2, p(66)
return list

regress response_num treatment_3 treatment_2 treatment_1 i.positionx_num i.specificfocusx_num i.femalex per_demx if ideot2<=-1.644315600395203  , cluster(cluster) // bottom quartile:  most liberal
regress response_num treatment_3 treatment_2 treatment_1 i.positionx_num i.specificfocusx_num i.femalex per_demx if ideot2>-1.644315600395203 & ideot2<= -.714104950428009  , cluster(cluster) // third quartile: moderate liberal
regress response_num treatment_3 treatment_2 treatment_1 i.positionx_num i.specificfocusx_num i.femalex per_demx if ideot2> -.714104950428009 & ideot2~=., cluster(cluster) // third quartile: most conservative

regress response_num treatment_3 treatment_2 treatment_1 i.positionx_num i.specificfocusx_num i.femalex per_demx if ideot2<=-1.216049   , cluster(cluster) // below median: more liberal
regress response_num treatment_3 treatment_2 treatment_1 i.positionx_num i.specificfocusx_num i.femalex per_demx if ideot2>-1.216049  & ideot2~=. , cluster(cluster) // above median: more conservative

*By Ideology Self-Report: Stratifying

regress response_num treatment_3 treatment_2 treatment_1 i.positionx_num i.specificfocusx_num i.femalex per_demx if ideology==1 | ideology==2   , cluster(cluster) //  liberal
regress response_num treatment_3 treatment_2 treatment_1 i.positionx_num i.specificfocusx_num i.femalex per_demx if ideology==3  , cluster(cluster) // middle
regress response_num treatment_3 treatment_2 treatment_1 i.positionx_num i.specificfocusx_num i.femalex per_demx if ideology==4 | ideology==5   , cluster(cluster) // conservative


*By Party Vote (Nothing)
*gen high_dem=1 if per_demx>=.4338465 & per_demx~=.
replace high_dem=0 if  per_demx<.4338465

regress response_num treatment_3 treatment_2 treatment_1 i.positionx_num i.specificfocusx_num i.femalex if high_dem==1, cluster(cluster) // relative to strong progressive
regress response_num treatment_3 treatment_2 treatment_1 i.positionx_num i.specificfocusx_num i.femalex if high_dem==0, cluster(cluster) // relative to strong progressive

regress response_num treatment_3##high_dem treatment_2##high_dem treatment_1##high_dem i.positionx_num i.specificfocusx_num i.femalex, cluster(cluster) // relative to strong progressive



*By Gender (Nothing)
regress response_num treatment_3 treatment_2 treatment_1 i.positionx_num i.specificfocusx_num  per_demx if femalex==1, cluster(cluster) // relative to strong conservative
regress response_num treatment_3 treatment_2 treatment_1 i.positionx_num i.specificfocusx_num per_demx if femalex==0, cluster(cluster) // relative to strong conservative
regress response_num treatment_3##i.femalex treatment_2##i.femalex treatment_1##i.femalex i.positionx_num i.specificfocusx_num per_demx, cluster(cluster) // relative to strong conservative

